package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-06-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_roll_record")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuRollRecord extends Model<GuRollRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "rr_id", type = IdType.AUTO)
    private Long rrId;

    /**
     * roll房id
     */
    private Long rrRollId;

    /**
     * 中奖用户id
     */
    private Long rrUserId;

    /**
     * 中奖人steamId
     */
    private String rrSteamId;

    /**
     * 中奖饰品
     */
    private Long rrGoodsId;

    /**
     * 库存id
     */
    private Long rrRollGoodsId;

    /**
     * 1 默认 2 指定
     */
    private Integer rrType;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime rrCreateTime;

    @TableField(exist = false)
    private Long inventoryId;


    @Override
    protected Serializable pkVal() {
        return this.rrId;
    }

}
